FROM  openjdk:21

MAINTAINER yefeng

ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-Xms512m -Xmx2048m"

RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /wind
ADD target/*.jar .
EXPOSE 52000

HEALTHCHECK --interval=10s --timeout=2s --start-period=30s --retries=10 \
  CMD curl -fS http://localhost:8141/actuator/health || exit 1

CMD sleep 1;java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar fenger-service.jar --spring.profiles.active=prod